construction of normal equation